<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<title>后台管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="icon" href="../static/favicon.ico">
	<link rel="stylesheet" href="../static/layui/css/layui.css" />
	<link rel="stylesheet" href="../static/css/index.css"  />
</head>
<body class="main_body">
<div class="layui-layout layui-layout-admin">
	<!-- 顶部 -->
	<div class="layui-header header" >
		<div class="layui-main mag0">
			<a href="#" class="logo">系统管理</a>
			<!-- 显示/隐藏菜单 -->
			<a href="javascript:;" class="seraph hideMenu icon-caidan"></a>
			<!-- 顶部右侧菜单 -->
			<ul class="layui-nav top_menu" >
				<li class="layui-nav-item" id="userInfo">
					<a href="javascript:;"><img  id="visit_images" class="layui-nav-img userAvatar"  ><cite class="adminName"></cite></a>
					<!--<a href="javascript:;"><img src="../static/images/4.jpeg" class="layui-nav-img userAvatar" width="35" height="35"><cite class="adminName"></cite></a>-->
					<dl class="layui-nav-child">
						<dd><a href="javascript:;" data-url="/sys/userInfo.html"><i class="seraph icon-ziliao" data-icon="icon-ziliao"></i><cite>个人资料</cite></a></dd>
						<dd><a href="javascript:;" data-url="/sys/userPassword.html"><i class="seraph icon-xiugai" data-icon="icon-xiugai"></i><cite>修改密码</cite></a></dd>
						<!--<dd pc><a href="javascript:;" class="functionSetting"><i class="layui-icon">&#xe620;</i><cite>功能设定</cite><span class="layui-badge-dot"></span></a></dd>-->
						<!--<dd pc><a href="javascript:;" class="changeSkin"><i class="layui-icon">&#xe61b;</i><cite>更换皮肤</cite></a></dd>-->
						<dd><a href="/logout" class="signOut"><i class="seraph icon-tuichu"></i><cite>退出</cite></a></dd>
					</dl>
				</li>
			</ul>
		</div>
	</div>

	<!-- 左侧导航 -->
	<div class="layui-side layui-bg-black">
		<!--<div class="user-photo">-->
			<!--&lt;!&ndash;<a class="img" title="我的头像" ><img src="../static/images/4.jpeg" class="userAvatar"></a>&ndash;&gt;-->
			<!--<p>您好！<span id="username" class="userName" th:text="${session.user}"></span></p>-->
		<!--</div>-->
		<!-- 搜索 -->
		<div class="layui-form component">
			<select name="search" id="search" lay-search lay-filter="searchPage">
				<option value="">搜索页面或功能</option>
			</select>
			<i class="layui-icon">&#xe615;</i>
		</div>

		<div class="navBar layui-side-scroll" id="navBar">
			<ul class="layui-nav layui-nav-tree">
				<li class="layui-nav-item layui-this">
					<a href="javascript:;" data-url="main.html"><i class="layui-icon" data-icon=""></i><cite>首页</cite></a>
				</li>
			</ul>
		</div>
	</div>

	<!-- 右侧内容 -->
	<div class="layui-body layui-form">
		<div class="layui-tab mag0" lay-filter="bodyTab" id="top_tabs_box">
			<ul class="layui-tab-title top_tab" id="top_tabs">
				<li class="layui-this" lay-id=""><i class="layui-icon">&#xe68e;</i> <cite>后台首页</cite></li>
			</ul>

			<ul class="layui-nav closeBox">
				<li class="layui-nav-item">
					<a href="javascript:;"><i class="layui-icon caozuo">&#xe643;</i> 页面操作</a>
					<dl class="layui-nav-child">
						<dd><a href="javascript:;" class="refresh refreshThis"><i class="layui-icon">&#xe669;</i> 刷新当前</a></dd>
						<dd><a href="javascript:;" class="closePageOther"><i class="seraph icon-prohibit"></i> 关闭其他</a></dd>
						<dd><a href="javascript:;" class="closePageAll"><i class="seraph icon-guanbi"></i> 关闭全部</a></dd>
					</dl>
				</li>
			</ul>

			<div class="layui-tab-content clildFrame">
				<div class="layui-tab-item layui-show">
				</div>
			</div>
		</div>
	</div>


<!--	<div class="layui-body">-->
<!--		&lt;!&ndash; 为ECharts准备一个具备大小（宽高）的DOM容器&ndash;&gt;-->
<!--		<div   id='echartsView' style='width:600px;height:400px;'></div>-->
<!--	</div>-->

</div>

<!-- 移动导航 -->
<div class="site-tree-mobile"><i class="layui-icon">&#xe602;</i></div>
<div class="site-mobile-shade"></div>
<script type="text/javascript" src="../static/layui/layui.js"></script>
<script src="../static/expand/main.js" charset="utf-8"></script>
<!--<script src="../static/js/index/index.js" charset="utf-8"></script>-->
<script type="text/javascript">
	var $,tab,dataStr,layer;
	layui.use(['bodyTab','layer','jquery', ],function(){
		var $ = layui.$;
		layer = parent.layer === undefined ? layui.layer : top.layer;

		tab = layui.bodyTab({
			openTabNum : "50",  //最大可打开窗口数量
			url : "/system/user/selectIndexMenu" //获取菜单json地址
		});

		//通过顶部菜单获取左侧二三级菜单   注：此处只做演示之用，实际开发中通过接口传参的方式获取导航数据
		function getData(json){
			$.getJSON(tab.tabConfig.url,function(data){
				dataStr = data;
				//重新渲染左侧菜单
				tab.render();
			})
		}

		//通过顶部菜单获取左侧菜单
		$(".topLevelMenus li,.mobileTopLevelMenus dd").click(function(){
			if($(this).parents(".mobileTopLevelMenus").length != "0"){
				$(".topLevelMenus li").eq($(this).index()).addClass("layui-this").siblings().removeClass("layui-this");
			}else{
				$(".mobileTopLevelMenus dd").eq($(this).index()).addClass("layui-this").siblings().removeClass("layui-this");
			}
			$(".layui-layout-admin").removeClass("showMenu");
			$("body").addClass("site-mobile");
			getData($(this).data("menu"));
			//渲染顶部窗口
			tab.tabMove();
		});

		//隐藏左侧导航
		$(".hideMenu").click(function(){
			if($(".topLevelMenus li.layui-this a").data("url")){
				layer.msg("此栏目状态下左侧菜单不可展开");  //主要为了避免左侧显示的内容与顶部菜单不匹配
				return false;
			}
			$(".layui-layout-admin").toggleClass("showMenu");
			//渲染顶部窗口
			tab.tabMove();
		});

		//通过顶部菜单获取左侧二三级菜单   注：此处只做演示之用，实际开发中通过接口传参的方式获取导航数据
		getData("contentManagement");

		//手机设备的简单适配
		$('.site-tree-mobile').on('click', function(){
			$('body').addClass('site-mobile');
		});
		$('.site-mobile-shade').on('click', function(){
			$('body').removeClass('site-mobile');
		});

		// 添加新窗口
		$("body").on("click",".layui-nav .layui-nav-item a:not('.mobileTopLevelMenus .layui-nav-item a')",function(){
			//如果不存在子级
			if($(this).siblings().length == 0){
				addTab($(this));
				$('body').removeClass('site-mobile');  //移动端点击菜单关闭菜单层
			}
			$(this).parent("li").siblings().removeClass("layui-nav-itemed");
		});

		//拿到员工信息
		$.ajax({
			type: "GET",
			contentType: "application/x-www-form-urlencoded",//设置请求参数类型为json字符串
			url: "/manage/employee/info",
			success: function (resp) {
				var code = resp.code;
				var data = resp.data;
				if (code === 200) {
					if (data!=undefined &&data.images!=undefined){
						$('#visit_images').attr('src', data.images).attr('width',35).attr('height',35); //图片链接（base64）
					}
				} else {
					layer.msg("图片加载失败", {icon: 5});
				}
			}
		});

	});

	//打开新窗口
	function addTab(_this){
		tab.tabAdd(_this);
	}


</script>
</body>
</html>